import React, { useState } from 'react';
import BoxItem from '../../../components/BoxItem';
import BorderTable from '../components/BorderTable';

import { Button, DatePicker, Form, Input, Select } from 'antd';

const { RangePicker } = DatePicker;

export default function InitialInventory() {
	const columns = [
		{ title: '商品编码', dataIndex: 'productId', key: 'productId' },
		{ title: '商品名称', dataIndex: 'productName', key: 'productName' },
		{ title: '库存单位', dataIndex: 'unit', key: 'unit' },
		{ title: '期初数量', dataIndex: 'count', key: 'count' },
		{ title: '期初成本均价', dataIndex: 'price', key: 'price' }
	];

	const dataSource = [
		{
			key: '1',
			productId: 'P001',
			productName: '商品A',
			unit: '件',
			count: 100,
			price: 15.5
		},
		{
			key: '2',
			productId: 'P001',
			productName: '商品A',
			unit: '件',
			count: 100,
			price: 15.5
		},
		{
			key: '3',
			productId: 'P001',
			productName: '商品A',
			unit: '件',
			count: 100,
			price: 15.5
		},
		{
			key: '4',
			productId: 'P001',
			productName: '商品A',
			unit: '件',
			count: 100,
			price: 15.5
		},
		{
			key: '5',
			productId: 'P001',
			productName: '商品A',
			unit: '件',
			count: 100,
			price: 15.5
		}
	];

	return (
		<div>
			<BoxItem>
				<Button size="large" style={{ marginRight: '20px' }}>
					导入
				</Button>
				<Button size="large">导出</Button>
			</BoxItem>
			<BoxItem>
				<Form
					layout="inline" // 使用 inline 布局使所有字段并排显示
					style={{ maxWidth: '100%' }}
				>
					<Form.Item label="仓库" style={{ width: '170px' }} wrapperCol={{ span: 15 }}>
						<Select defaultValue="请选择">
							<Select.Option value="仓库A">仓库A</Select.Option>
							<Select.Option value="仓库B">仓库B</Select.Option>
							<Select.Option value="仓库C">仓库C</Select.Option>
							<Select.Option value="仓库D">仓库D</Select.Option>
							<Select.Option value="仓库E">仓库E</Select.Option>
						</Select>
					</Form.Item>
					<Form.Item label="创建时间" style={{ width: '350px' }} wrapperCol={{ span: 20 }}>
						<RangePicker />
					</Form.Item>
					<Form.Item style={{ width: '180px' }} wrapperCol={{ span: 20 }}>
						<Input placeholder="请输入关键词" />
					</Form.Item>
					<Form.Item>
						<Button type="primary" style={{ marginRight: '20px' }}>
							搜索
						</Button>
						<Button>重置</Button>
					</Form.Item>
				</Form>
			</BoxItem>

			<BoxItem>
				<BorderTable columns={columns} dataSource={dataSource} />
			</BoxItem>
		</div>
	);
}
